//
//  Dictionary.JSON.swift
//  App_Common
//
//  Created by liulihui on 2021/3/30.
//

import Foundation

public extension Dictionary {
    func toJsonString() -> String? {
        guard let data = try? JSONSerialization.data(withJSONObject: self, options: []) else {
            return nil
        }
        guard let str = String(data: data, encoding: .utf8) else {
            return nil
        }
        return str
    }
}
